%%ERGASTHRIO 1
%%ONOMA:DHMAS
%%AEM:NIKOS 822
%%TMHMA:1
%%EMAIL:NIDIMAS@UTH.GR



%ASKHSH 1
%Oriste ena dianysma y me 18 stoixeia, pou kaqe tou stoixeio einai iso me to 
%triplasio ths qeshs toy meion 9.
for k=1:1:18
y(k) = 3*k - 9
end
%ASKHSH 2
%Ypologiste th 2h dynamh twn stoixeiwn tou y.
d=y.*y
%ASKHSH 3
%Ypologiste to eswteriko ginomeno tou dianysmatos x me ton eayto tou 
eg = y* y'

%ASKHSH 4
%Ypologiste thn eykleidia norma tou x xrhsimopoiwntas thn synarthsh norm.
%Ti sxesh exei to nor2 me thn timh ths eg?

nor2 = norm(y,2) 
%i norma einai i riza tis eg

%ASKHSH 5 
%Kante th grafikh parastash twn zevgariwn (y(i),d(i)), i=1,2,3,....

%diary off


plot(y,d)